// ActionScript file
import com.helloniu.data.wb.TextStyle;
import com.helloniu.data.wb.WBStyle;
import com.helloniu.fl.util.StyleTool;

private var textStyle:TextStyle = new TextStyle();
private var textStyle2:TextStyle = new TextStyle();

private function initComp(e:*):void {
    StyleTool.setBtnStyle(applyBtn, "applyIcon");
}

public function populate():void {
	textContent.text = textStyle.content;
}

public function update():void {
	textStyle2.content = textContent.text;

	// @temp tonyy, event
	// fire ModifyEvent()
}

public function getWBStyle():WBStyle {
	update();

	return textStyle2;
}

public function setWBStyle(awbstyle:WBStyle):void {
	textStyle = awbstyle as TextStyle;
}

override protected function updateDisplayList(w:Number, h:Number):void {
	super.updateDisplayList(w, h);
	
	if(w > 0 && h > 0) {
		populate();
	}	
}
